<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <meta charset="UTF-8">
    <title>修改测试图片的数量</title>
    <script type="application/javascript" th:src="@{/webjars/jquery/3.3.1/jquery.js}"></script>
    <script type="application/javascript" th:src="@{/webjars/bootstrap/3.1.1/js/bootstrap.js}"></script>
    <script>
        $(function () {
            $("#saveBtn").click(function () {
                var userTestTimes = $("#userTestTimes").val();
                var timePartition = $("#timePartition").val();
                var testTime = $("#testTime").val();
                var changeImageTime = $("#changeImageTime").val();
                if (userTestTimes.length == 0 || timePartition.length == 0 || testTime.length == 0 || changeImageTime.length == 0) {
                    alert("请输入完整的信息！");
                } else {
                    var param = {
                        'userTestTimes': userTestTimes,
                        'timePartition': timePartition,
                        "testTime": testTime,
                        "changeImageTime": changeImageTime
                    };
                    $.ajax({
                        type: 'post',
                        dataType: 'json',
                        contentType: 'application/json',
                        url: '/ED_threshold_training/timeConfigure/modify',
                        data: JSON.stringify(param),
                        success : function(result) {
                            if (result.state == 200) {
                                $("#tip").text("修改成功！");
                                alert("修改成功！");
                            }else {
                                alert("修改失败！")
                            }
                        }
                    });
                }
            });
        });
    </script>
</head>
<body>
<div>
    <form class="form-inline">
        <div class="form-group">
            <label for="userTestTimes">被试测试次数：</label>
            <input type="text" class="form-control" id="userTestTimes">
        </div>
        <div class="form-group">
            <label for="timePartition">被试测试时间段（如9-11;13-15;17-19 ;是半角符号;简单实现只支持配置整点）：</label>
            <input type="text" class="form-control" id="timePartition" >
        </div>
        <div class="form-group">
            <label for="testTime">被试测试时每个时间分区可以进行测试的时间(单位分钟)：</label>
            <input type="text" class="form-control" id="testTime" >
        </div>
        <div class="form-group">
            <label for="changeImageTime">图片切换时间(单位MS)：</label>
            <input type="text" class="form-control" id="changeImageTime" >
        </div>
        <button type="submit" class="btn btn-default" id="saveBtn" onclick="">保存</button>
    </form>
    <div id="tip">

    </div>
</div>
</body>
</html>